#############使用函数嵌套进行语法糖传参
def sugar(level):
    def login(func):
        username="sumaolin"
        password="aisuyuxi"
        def inner():
            if username == "sumaolin" and password == "aisuyuxi":  #1
                print(f"您的会员等级为{level}")#2
                return func() #3
            else:
                print("你无权限，请与管理员联系")
                return 0
        return inner
    return login

@sugar(3)
def index(): #4
    print("这里有着大家要的学习资料")
    print("suyuxi")


if __name__ == "__main__":
    index()